<?php
/**
 * 会员后台控制器
 * 
 * @version $Id: Order.php 289 2012-05-02 08:40:09Z linsir123 $
 */
class controllerOrder extends UserController 
{
	/**
	 * @var 模型
	 */
	public $mOrder;
	
	/**
	 * 构造函数
	 */
	public function __construct()
	{
		parent::__construct();
		
		///
		$this->mOrder = M::order();
	}
	
	/**
	 * 我的订单
	 */
	public function actionList()
	{
		if (Request::isAjax() && Request::isPost()) {
			$show = 10;
			$params = array();
			
			///
			if ($count = $this->mOrder->getListCount($params)) {
				$page = $this->pagination($show, $count, 'order/list');
				$list = $this->mOrder->getList(($page-1)*$show, $show, $params);
			}
			
			///
			View::display('_order_div');
			View::assign('list', $list);
			App::end();
		}
		
		///
		View::display('order');
		View::assign('curMenu', 'order');
		AppView::addCss('javascript/JSCal2-1.9/src/css/jscal2.css');
		AppView::addCss('javascript/JSCal2-1.9/src/css/steel/steel.css');
		AppView::addJs('JSCal2-1.9/src/js/jscal2.js');
		AppView::addJs('JSCal2-1.9/src/js/lang/cn.js');
	}
}
